﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using W.Common.Enum;
using W.Warehouse.Domain.DTO;
using W.Warehouse.Read.Api.Application.Command.OutboundCommand;
using Microsoft.AspNetCore.Http.HttpResults;

namespace W.Warehouse.Read.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [Authorize]
    public class OutboundController : ControllerBase
    {
        private readonly IMediator mediator;

        public OutboundController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 出库显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<List<OutboundDTO>> OutboundAdd(OutboundShowCommand command)
        {
              return await mediator.Send(command);
        }
        /// <summary>
        /// 产品显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<List<OutboundProductDTO>> OutProductShow(OutboundFanAllCommand command)
        {
            return await mediator.Send(command);
        }
    }
}
